/*
Copyright (C) 2010 Andrew Dieffenbach (www.puzzud.com).

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

package com.puzzud.engine.video;

import com.puzzud.engine.video.VideoObject2D;

// MoveableObject2D
public abstract class VideoMoveableObject2D extends VideoObject2D
{
	protected int xVelocity;
	protected int yVelocity;
	
	public VideoMoveableObject2D()
	{
		super();
		
		setVelocity( 0, 0 );
	}
	
	public void setXVelocity( int xv )
	{
		xVelocity = xv;
	}
	
	public void setYVelocity( int yv )
	{
		yVelocity = yv;
	}
	
	public void setVelocity( int xv, int yv )
	{
		setXVelocity( xv );
		setYVelocity( yv );
	}
	
	public int getXVelocity()
	{
		return( xVelocity );
	}
	
	public int getYVelocity()
	{
		return( yVelocity );
	}
	
	public void move()
	{
		setPosition( getXPosition() + xVelocity, getYPosition() + yVelocity );
	}
	
	public void stop()
	{
		setVelocity( 0, 0 );
	}
	
	protected abstract void setRealDimensions( int width, int height );
	
	abstract int getRealWidth();
	abstract int getRealHeight();
}